package cn.lingyangwl.agile.msg.push.assembly;

import cn.lingyangwl.agile.msg.push.model.entity.*;
import cn.lingyangwl.agile.msg.push.model.rqrs.history.*;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 消息推送
 *
 * @author shenguangyang
 */
@Mapper(componentModel = "spring")
public interface MsgHistoryAssembly {

    @Mappings({
            @Mapping(source = "id", target = "id"),
            @Mapping(source = "noticeId", target = "noticeId"),
            @Mapping(source = "channelCode", target = "channelCode"),
            @Mapping(source = "groupName", target = "groupName"),
            @Mapping(source = "channelType", target = "channelType"),
            @Mapping(source = "msgFields", target = "msgFields"),
            @Mapping(source = "status", target = "status"),
            @Mapping(source = "pushResult", target = "pushResult"),
            @Mapping(source = "toUser", target = "toUser"),
            @Mapping(source = "pushTime", target = "pushTime"),
            @Mapping(source = "bizKey", target = "bizKey"),
            @Mapping(source = "bizType", target = "bizType"),
    })
    HistoryQueryResp toMsgHistoryQueryResp(MsgHistory history);
}